﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Chapter03_Lesson02
{
    class Program
    {
        static void Main(string[] args)
        {
            EncodingInfo []e = Encoding.GetEncodings();

            foreach (EncodingInfo enconding in e)
            {
                Console.WriteLine("Display Name = {1}, Name = {2} and Code page = {0}.", enconding.CodePage, enconding.DisplayName, enconding.Name);
            }

            Console.Read();

            StreamReader sr = new StreamReader(@"C:\windows\win.ini");
            StreamWriter sw = new StreamWriter("test.txt", false, Encoding.UTF7);

            sw.Write(sr.ReadToEnd());

            sw.Close();
            sr.Close();

        }
    }
}
